package ch.unisi.inf.gui.action;

import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import javax.swing.*;
import javax.swing.AbstractAction;
import javax.swing.Action;


/**
 * @author bejarj@lu.unisi.ch
 *
 */
public class MinimiseAction extends AbstractAction{
	
	JFrame frame;
	
	public MinimiseAction(JFrame frame){
		this.frame = frame;
		putValue(Action.NAME, "Minimise");
		putValue(Action.MNEMONIC_KEY, KeyEvent.VK_M);
		putValue(Action.SHORT_DESCRIPTION, "Minimise the window");
	}
	public void actionPerformed(ActionEvent e) {

		frame.setState(frame.ICONIFIED);

		
	}

}
